package com.luli.entity.tree;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 陆离
 * 2022/7/30 17:46:17
 */
@Data
@ToString
public class CatalogVO implements Serializable {
    private String id;
    private String parentId;
    private String name;
    private String age;
    private String sex;
    List chirldren = new ArrayList<>();
    @JsonIgnore
    private boolean isHasChild;

    public boolean isHasChild() {
        return chirldren == null || chirldren.size() <= 0;
    }

    public void checkChild() {
        if (chirldren == null || chirldren.size() <= 0) {
            isHasChild = false;
        } else {
            isHasChild = true;
        }
    }
}
